import {
    setTimeout
} from "core-js";

export default {
    namespaced: true,
    state: {
        isShowToast: false,

        //提示内容 
        toastMsg: '手机号',

        // 提示类型
        toastType: '类型'
    },
    mutations: {
        changeIsShowToast(state, payload) {
            state.isShowToast = payload.isshow;
            if (payload.isshow) {
                state.toastMsg = payload.msg;
                state.toastType = payload.type
            }

        }
    },
    actions: {
        asyncChangeIsShowToast(context, payload) {
            context.
            commit('changeIsShowToast', payload);
            setTimeout(() => {
                context.commit('changeIsShowToast', {
                    isshow: false
                })
            },1000)
        }
    }

}